using System;
using System.Collections.Generic;
using System.Text;

namespace AVR109Boot
{
    public class ChipData
    {
        /// <summary>
        /// number of words per page
        /// </summary>
        public int PageSize;
        /// <summary>
        /// number of pages in the NRWW section
        /// </summary>
        public int NRWWSize;
        /// <summary>
        /// number of 8 bit bytes of flash memory in the chip
        /// </summary>
        public int TotalMemory;

        public ChipData(int PageSize,int NRWWSize,int NumberOfPages)
        {
            this.PageSize = PageSize;
            this.NRWWSize = NRWWSize;
            this.TotalMemory = NumberOfPages * PageSize*2 ;
        }

    }
    public static class AVRChipData
    {
        public static ChipData ATmega8 = new ChipData(32, 32, 128);
        public static ChipData ATmega8515 = new ChipData(32, 32, 128);
        public static ChipData ATmega8535 = new ChipData(32, 32, 128);
        public static ChipData ATmega88 = new ChipData(32, 32, 128);
        public static ChipData ATmega16 = new ChipData(64, 16, 128);
        public static ChipData ATmega162 = new ChipData(64, 16, 128);
        public static ChipData ATmega163 = new ChipData(64, 16, 128);
        public static ChipData ATmega165 = new ChipData(64, 16, 128);
        public static ChipData ATmega168  = new ChipData(64, 16, 128);
        public static ChipData ATmega169 = new ChipData(64, 16, 128);
        public static ChipData ATmega32 = new ChipData(64, 32, 256);
        public static ChipData ATmega323 = new ChipData(64, 16, 256);
        public static ChipData ATmega329 = new ChipData(64, 32, 256);
        public static ChipData ATmega3290 = new ChipData(64, 32, 256);
        public static ChipData ATmega64 = new ChipData(128, 32, 256);
        public static ChipData ATmega649 = new ChipData(128, 32, 256);
        public static ChipData ATmega6490 = new ChipData(128, 32, 256);
        public static ChipData ATmega128 = new ChipData(128, 32, 512);
        public static ChipData ATmega128_1 = new ChipData(128, 32, 512);
    }
}
